|
HSL 2.0 framework
Description of the framework
|
All methods of the TCP client More..
Public Member Functions | |
| def | __init__ (self, framework, context_map) |
| Constructor. More... | |
| def | set_address (self, ip, port) |
| Sets the destination address. More... | |
| def | set_on_connect (self, callback) |
| Sets a callback method. More... | |
| def | set_on_data (self, callback) |
| Sets a callback method. More... | |
| def | set_on_error (self, callback) |
| Sets the callback method. More... | |
| def | set_on_close (self, callback) |
| Sets the callback method. More... | |
| def | connect (self) |
| Attempts to establish a connection to the configured remote party. More... | |
| def | close (self) |
| Closes the current connection. More... | |
| def | send (self, data) |
| Sends data to the remote party. More... | |
All methods of the TCP client
Used to communicate with a remote party via TCP/IP
| def hsl20_4_tcp.hsl20_4_tcp.Client.__init__ | ( | self, | |
| framework, | |||
| context_map | |||
| ) |
Constructor
| def hsl20_4_tcp.hsl20_4_tcp.Client.close | ( | self | ) |
Closes the current connection
| def hsl20_4_tcp.hsl20_4_tcp.client.connect | ( | self | ) |
Attempts to establish a connection to the configured remote party
| AttributeError | Is triggered if no IP address or port has been defined yet |
| RuntimeError | If this method is called while the client is already connected, a RuntimeError exception is thrown |
| def hsl20_4_tcp.hsl20_4_tcp.client.send | ( | self, | |
| data | |||
| ) |
Sends data to the remote party
| data | string Data to be sent |
| def hsl20_4_tcp.hsl20_4_tcp.Client.set_address | ( | self, | |
| ip, | |||
| port | |||
| ) |
Sets the destination address
| ip | string IP address or hostname |
| port | int IP port |
| RuntimeError | If this method is called while the client is already connected, a RuntimeError exception is thrown |
| def hsl20_4_tcp.hsl20_4_tcp.Client.set_on_close | ( | self, | |
| callback | |||
| ) |
Sets the callback method
The method is called when the connection (from the remote party) is closed.
No parameters are transferred to the callback.
| callback | function Callback method |
| def hsl20_4_tcp.hsl20_4_tcp.Client.set_on_connect | ( | self, | |
| callback | |||
| ) |
Sets a callback method
The method is called when a connection to the remote party is established.
No parameters are passed to the callback.
| callback | function Callback method |
| def hsl20_4_tcp.hsl20_4_tcp.Client.set_on_data | ( | self, | |
| callback | |||
| ) |
Sets a callback method
The method is called when a TCP/IP message is received.
| callback | function Callback method
|
| def hsl20_4_tcp.hsl20_4_tcp.Client.set_on_error | ( | self, | |
| callback | |||
| ) |
Sets the callback method
The method is called if an error has occurred in the communication.
Parameters for callback:
| callback | function callback method |
1.8.13